/*
 * Copyright 2010 - Jeremie Brebec
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.jb.coinche.client.gin;

import java.util.HashSet;
import java.util.Set;

import org.jb.notification.client.NotificationListener;
import org.jb.statemachine.client.impl.GUIStateMachine;
import org.jb.ui.chat.client.ChatWidget;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;

public class CoincheNotificationListenerModule extends AbstractGinModule {

	@SuppressWarnings("unchecked")
	@Override
	protected void configure() {
		bind( new TypeLiteral< Set<NotificationListener> >() {}).toProvider(NotificationListenerProvider.class);
		
	}

	/*
	 * 
	 */
	@SuppressWarnings("unchecked")
	public static class NotificationListenerProvider implements Provider< Set<NotificationListener > > {

		@Inject
		private ChatWidget h1;
		
		@Inject
		private GUIStateMachine h2;
		
		@Override
		public Set<NotificationListener> get() {
			Set<NotificationListener > set = new HashSet< NotificationListener >();
			set.add(h1);
			set.add(h2);

			return set;
		}
	}
	
}
